(function() {

    var $u = juliet.using({ validator : 'juliet.validation.validator' });

    /**
     * Select validator
     */
    var SelectClass = function() {

        this.validate = function() {
            var
            value = this.chain.fieldValueHelper.fieldValue,
            wrongValues = this.getOptionValue('wrongValues');

            for (var i = 0; i < wrongValues.length; ++i) {
                if (value == wrongValues[i]) {
                    this.result = vr.FAILED;
                    return;
                }
            }

            this.result = vr.SUCCESS;
        };

        this.getError = function() {
            return this.base.getError.call(this, 'select');
        };

    };

    $u('validator').addValidator('Select', SelectClass);

})();
